import java.sql.Connection;
import java.sql.DriverManager;

public class DatabaseConnection {

	private static Connection c;




	public  Connection connect() {
		if(c == null)
		{
			try {
				Class.forName("org.postgresql.Driver");
				c = DriverManager
						.getConnection("jdbc:postgresql://149.210.188.153:8080/postgres",	"postgres", "99719797");
			} catch (Exception e) {
				e.printStackTrace();
				System.err.println(e.getClass().getName()+": "+e.getMessage());
				System.exit(0);	
			}
			System.out.println("Opened database successfully");
			return c;
		}
	
		return c;
	}
}